import { PLAYER_UPDATE_ATTRS } from './Enums/index'
import EventManager from './EventManager'

const { ccclass } = cc._decorator

@ccclass
export default class PlayerAttrControler extends cc.Component {
  addATK(event: Event, params: string) {
    EventManager.emit(PLAYER_UPDATE_ATTRS.ATK, params)
  }
  addHP(event: Event, params: string) {
    EventManager.emit(PLAYER_UPDATE_ATTRS.HP, params)
  }
  addHPRE(event: Event, params: string) {
    EventManager.emit(PLAYER_UPDATE_ATTRS.HPRE, params)
  }
  addASPD(event: Event, params: string) {
    EventManager.emit(PLAYER_UPDATE_ATTRS.ASPD, params)
  }
  addCRT(event: Event, params: string) {
    EventManager.emit(PLAYER_UPDATE_ATTRS.CRT, params)
  }
  addCRTCHANCE(event: Event, params: string) {
    EventManager.emit(PLAYER_UPDATE_ATTRS.CRTCHANCE, params)
  }
  onLoad() {}
}
